package center.leon.zoofeignsentinelimplalpha;

import center.leon.zoofeignsentinelimplalpha.holder.DynamicValueHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.concurrent.TimeUnit;

/**
 * @author xuxinmin
 */
@Slf4j
@EnableFeignClients(value = "center.leon")
@EnableDiscoveryClient
@SpringBootApplication
public class ZooFeignSentinelImplAlphaApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext run = SpringApplication.run(ZooFeignSentinelImplAlphaApplication.class, args);
        DynamicValueHolder holder = run.getBean(DynamicValueHolder.class);
        for(;;){
            log.info("holder#value : {}", holder.getValue());
            TimeUnit.SECONDS.sleep(1);
        }
    }

}
